package com.vogue.supplymall.order.domain.mapper;

import com.vogue.ssm.database.util.SqlLangDriver;
import com.vogue.supplymall.order.domain.model.OrderBuyer;
import org.apache.ibatis.annotations.Lang;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * The interface Order buyer mapper.
 *
 * @aouthor: zhangliang
 * @date: Create in 2018-01-10
 */
@Mapper
public interface OrderBuyerMapper extends BaseMapper<OrderBuyer, Long> {

    /**
     * Search order buyer list.
     *
     * @param orderBuyer the order buyer
     * @return the list
     */
    @Select("select ob.* from order_buyer ob,`order` o " +
            "where o.id = ob.orderid and o.commitflag = 0 and ob.organid = #{organid} and ob.userid = #{userid} and ob.syscodeid = #{syscodeid}")
    @Lang(SqlLangDriver.class)
    List<OrderBuyer> searchOrderBuyer(OrderBuyer orderBuyer);
}
